package recursive.numTrees;
/**
 * @Date 2020/04/02
 * @author 王光浩
 * @Thinking 使用递归
 */
public class MyMethodOne {
	public int numTrees(int n) {
		return helper(1,n);
    }
	private int helper(int l,int r) {
		if(r-l<=0)return 1;
		int count=0;
		for(int i=l;i<=r;i++) {
			count+=helper(l,i-1)*helper(i+1,r);
		}
		return count;
	}
}
